'''
# 现有一个字符串 ”hello你好。1,23wfsafeasd“
# 打印出字符串中每个字符出现次数
a = str(input())
count1 = 0
count2 = 0
count3 = 0
count4 = 0
for c in a:
    if 0x4E00 <= ord(c) <= 0x9FA5:
        count1 += 1
    elif 'a' <= c <= 'z' or 'A' <= c <= 'Z':
        count2 += 1
    elif c.isdigit():
        count3 += 1
    else:
        count4 += 1
print("中文字符个数是%d" % count1)
print("字母字符个数是%d" % count2)
print("数字字符个数是%d" % count3)
print("其它字符个数是%d" % count4)
'''
s=input()
d={}
b=0
for i in s:
    temp=d.get(i,0)
    d[i]=temp+1
for n in d:
    if d[n]>b:
        b=d[n]
        c=n
print(d)
print(c)
